order-list.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <?php
  2. $activity_id = Yii::$app->request->getQueryParam('activity_id');
  3. $activity_id = $activity_id ? $activity_id : 0;
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <div>
  9. <span>拼团订单</span>
  10. <div style="float: right; margin: -5px 0">
  11. <com-export-dialog :field_list='exportList' :params="searchData">
  12. </com-export-dialog>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="table-body">
  17. <el-date-picker
  18. class="item-box"
  19. size="small"
  20. @change="changeTime"
  21. v-model="searchData.time"
  22. type="datetimerange"
  23. value-format="yyyy-MM-dd HH:mm:ss"
  24. range-separator="至"
  25. start-placeholder="开始日期"
  26. end-placeholder="结束日期">
  27. </el-date-picker>
  28. 会员编号:
  29. <div class="input-item">
  30. <el-input @keyup.enter.native="search" size="small" placeholder="用户ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
  31. </div>
  32. 会员昵称:
  33. <div class="input-item">
  34. <el-input @keyup.enter.native="search" size="small" placeholder="用户昵称" v-model="searchData.nickname" clearable @clear="search"></el-input>
  35. </div>
  36. 订单编号:
  37. <div class="input-item">
  38. <el-input @keyup.enter.native="search" size="small" placeholder="订单编号" v-model="searchData.order_sn" clearable @clear="search"></el-input>
  39. </div>
  40. 拼单状态:
  41. <el-select size="small" v-model="searchData.status" @change='search' class="select" style="float:none;width: 140px;">
  42. <el-option key="0" label="请选择拼单状态" value="0"></el-option>
  43. <el-option key="1" label="参团中" value="1"></el-option>
  44. <el-option key="2" label="拼团成功" value="2"></el-option>
  45. <el-option key="3" label="拼团失败" value="3"></el-option>
  46. </el-select>
  47. 商品名称:
  48. <div class="input-item">
  49. <el-input @keyup.enter.native="search" size="small" placeholder="商品名称" v-model="searchData.goods_name" clearable @clear="search"></el-input>
  50. </div>
  51. <div style="display: inline-block;margin-left: 10px;">
  52. <el-button type="primary" size="small" @click="search">查询</el-button>
  53. <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
  54. </div>
  55. <el-table class="table-info" :data="form" stripe style="width: 100%" v-loading="listLoading">
  56. <el-table-column prop="id" label="ID" width="60" align="center"></el-table-column>
  57. <el-table-column label="会员" width="180">
  58. <template slot-scope="scope">
  59. <div style="display: flex;align-items: center;">
  60. <com-image style="margin-right: 5px;display: block;flex-shrink: 0;border-radius:5px" mode="aspectFill" :src="scope.row.avatar_url ? scope.row.avatar_url : ''"></com-image>
  61. <div v-if="scope.row" style="line-height: 18px;">
  62. <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  63. <div v-else>{{scope.row.username}}</div>
  64. <div>用户id:{{scope.row.user_id}}</div>
  65. </div>
  66. </div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="order_sn" label="拼团订单编号" align="center">
  70. <template slot-scope="scope">{{scope.row.order_sn ? scope.row.order_sn :'--'}}</template>
  71. </el-table-column>
  72. <el-table-column prop="status" label="拼团状态" width="100" align="center">
  73. <template slot-scope="scope">{{statusArr[scope.row.status]? statusArr[scope.row.status] :'--'}}</template>
  74. </el-table-column>
  75. <el-table-column prop="attend_type" label="拼团方式" align="center">
  76. <template slot-scope="scope">{{attendTypeArr[scope.row.attend_type]? attendTypeArr[scope.row.attend_type] :'--'}}</template>
  77. </el-table-column>
  78. <el-table-column prop="pay_money" label="订单金额" align="center"></el-table-column>
  79. <el-table-column prop="activity_name" label="活动名称" align="center"></el-table-column>
  80. <el-table-column prop="goods_name" label="商品名称" align="center"></el-table-column>
  81. <el-table-column prop="buy_nums" label="购买数量" align="center"></el-table-column>
  82. <el-table-column prop="win_nums" label="中奖数量" align="center"></el-table-column>
  83. <el-table-column prop="win_time" label="拼中时间" width="160px" align="center">
  84. <template slot-scope="scope">
  85. {{scope.row.win_time|dateTimeFormat('Y-m-d H:i:s')}}
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="created_at" label="参团时间" width="160px" align="center">
  89. <template slot-scope="scope">
  90. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <div style="text-align: right;margin: 20px 0;">
  95. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  96. </div>
  97. </div>
  98. </el-card>
  99. </div>
  100. <script>
  101. var activity_id = <?php echo $activity_id?>;
  102. const app = new Vue({
  103. el: '#app',
  104. data() {
  105. return {
  106. searchData: {
  107. user_id:'',
  108. nickname:'',
  109. order_sn:'',
  110. status:'',
  111. activity_id:'',
  112. date_start:'',
  113. date_end:'',
  114. },
  115. status: '0',
  116. form: [],
  117. member: [],
  118. pageCount: 0,
  119. page: 1,
  120. member_page: 1,
  121. currentPage: null,
  122. listLoading: false,
  123. btnLoading: false,
  124. statusArr:[],
  125. attendTypeArr:[],
  126. // 导出
  127. exportList: [],
  128. };
  129. },
  130. methods: {
  131. openId(index) {
  132. let item = this.form;
  133. item[index].is_open_id = !item[index].is_open_id;
  134. this.form = JSON.parse(JSON.stringify(this.form));
  135. },
  136. changeTime() {
  137. if (this.searchData.time) {
  138. this.searchData.date_start = this.searchData.time[0];
  139. this.searchData.date_end = this.searchData.time[1];
  140. } else {
  141. this.searchData.date_start = null;
  142. this.searchData.date_end = null;
  143. }
  144. },
  145. //搜索
  146. search() {
  147. this.page = 1;
  148. this.getList();
  149. },
  150. pagination(currentPage) {
  151. this.page = currentPage;
  152. this.getList();
  153. },
  154. getList() {
  155. this.listLoading = true;
  156. request({
  157. params: {
  158. r: 'plugin/lucky_group/mall/bill/order-list',
  159. page: this.page,
  160. user_id:this.searchData.user_id,
  161. nickname:this.searchData.nickname,
  162. goods_name:this.searchData.goods_name,
  163. order_sn:this.searchData.order_sn,
  164. status:this.searchData.status,
  165. date_start:this.searchData.date_start,
  166. date_end:this.searchData.date_end,
  167. activity_id:activity_id,
  168. pagesize:10
  169. },
  170. }).then(e => {
  171. if (e.data.code === 0) {
  172. this.form = e.data.data.list;
  173. this.pageCount = e.data.data.page_count;
  174. this.currentPage = e.data.data.pagination.current_page;
  175. this.exportList = e.data.data.exportList;
  176. this.mall_members = e.data.data.mall_members;
  177. this.statusArr = e.data.data.statusArr;
  178. this.attendTypeArr = e.data.data.attendTypeArr;
  179. } else {
  180. this.$message.error(e.data.msg);
  181. }
  182. this.listLoading = false;
  183. }).catch(e => {
  184. this.listLoading = false;
  185. });
  186. },
  187. //重置
  188. resetForm() {
  189. this.searchData.user_id = '';
  190. this.searchData.nickname = '';
  191. this.searchData.order_sn = '';
  192. this.searchData.status = '';
  193. },
  194. },
  195. mounted: function() {
  196. this.page = getQuery('page') ? getQuery('page') : 1;
  197. this.getList();
  198. }
  199. });
  200. </script>
  201. <style>
  202. .table-body {
  203. padding: 20px;
  204. background-color: #fff;
  205. }
  206. /* .table-info .el-button {
  207. padding: 0 !important;
  208. border: 0;
  209. margin: 0 5px;
  210. } */
  211. .input-item {
  212. display: inline-block;
  213. width: 150px;
  214. margin: 0 0 20px;
  215. }
  216. .input-item .el-input__inner {
  217. border-right: 1px solid #dcdfe6;
  218. }
  219. .input-item .el-input__inner:hover {
  220. border: 1px solid #dcdfe6;
  221. border-right: 0;
  222. outline: 0;
  223. }
  224. .input-item .el-input__inner:focus {
  225. border: 1px solid #dcdfe6;
  226. border-right: 0;
  227. outline: 0;
  228. }
  229. .input-item .el-input-group__append {
  230. background-color: #fff;
  231. border-left: 0;
  232. width: 10%;
  233. padding: 0;
  234. }
  235. .input-item .el-input-group__append .el-button {
  236. padding: 0;
  237. }
  238. .input-item .el-input-group__append .el-button {
  239. margin: 0;
  240. }
  241. .select {
  242. float: left;
  243. width: 100px;
  244. margin-right: 10px;
  245. }
  246. .el-table th>.cell {
  247. color: #333;
  248. font-weight: bold;
  249. font-size: 14px;
  250. }
  251. .el-table__footer-wrapper,
  252. .el-table__header-wrapper {
  253. border-bottom: 1.4px solid #D6D6D6;
  254. }
  255. </style>